#include <stdio.h>

int main(){
    int m;
    int n;
    double i;
    double sum1 = 0;
    double sum2 = 0;
    scanf("%d %d",&m,&n);
    for(i=m;i<=n;i++){
        sum1 = sum1 + 1 / i;
    }
    for(i=m;i<=n;i++){
        sum2 = sum2 + i * i;
    }
    sum1 = sum1 + sum2;
    printf("sum = %f\n",sum1);
    
    return 0;
}